import {axios} from '@/utils/request'


//获取区域
export function ReturnVisitReport() {
  return axios({
    url: '/customer/ReturnVisit/report',
    method: 'get',
  })
}

//获取区域
export function getArea() {
  return axios({
    url: '/common/area',
    method: 'get',
  })
}
//获取二级区域
export function getArea2(id) {
  return axios({
    url: '/customer/Area2/' +id,
    method: 'get',
  })
}


//获取信息来源
export function getInfoSource() {
  return axios({
    url: '/common/infoSource',
    method: 'get',
  })
}
//获取二级信息来源
export function getInfoSource2(id) {
  return axios({
    url: '/customer/InfoSource2/' +id,
    method: 'get',
  })
}

//获取接听状态
export function getAnswerState() {
  return axios({
    url: '/customer/AnswerState',
    method: 'get',
  })
}

//获取接听状态
export function getCustomerConsult() {
  return axios({
    url: '/common/customerConsult',
    method: 'get',
  })
}
//获取开单人
export function getSale(){
  return axios({
    url:'',
    method:''
  })
}
//开单树
export function getTree(params){
  return axios({
    url:'/customer/getconsultation',
    method:'get',
    params:params
  })
}

//获取回访方式
export function getReturnMethod() {
  return axios({
    url: '/customer/ReturnMethod',
    method: 'get',
  })
}

// 查询客户列表
export function listCustomer(query) {
  return axios({
    url: '/customer/customer/list',
    method: 'get',
    params: query
  })
}
//客户主诉
export function getdb(){
  return axios({
    url:'/customer/getdepartments',
    method:'get'
  })
}

// 查询客户详细
export function getCustomer(id) {
  return axios({
    url: '/customer/customer/' + id,
    method: 'get'
  })
}

// 新增客户
export function addCustomer(data) {
  return axios({
    url: '/customer/customer',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomer(data) {
  return axios({
    url: '/customer/customer',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomer(id) {
  return axios({
    url: '/customer/customer/' + id,
    method: 'delete'
  })
}

// 获取客户资料
export function getCustomerProfile(id) {
  return axios({
    url: '/customerDetails/customerProfile/'+id ,
    method: 'get',
  })
}

// 获取客户资料
export function getCustomerProfileByCustomerId(id) {
  return axios({
    url: '/customerDetails/customerProfileByCustomerId/'+id ,
    method: 'get',
  })
}

// 获取客户档案
export function customerFileNumberByCustomerId(id) {
  return axios({
    url: `/customerDetails/customerFileNumberByCustomerId/${id}` ,
    method: 'get',
  })
}

// 获取客户归属
export function customerUserByCustomerId(id) {
  return axios({
    url: `/customerDetails/customerUserByCustomerId/${id}` ,
    method: 'get',
  })
}

// 获取客户回访情况
export function getReturnVisitById(id) {
  return axios({
    url: '/customerDetails/returnVisit/' + id,
    method: 'get',
  })
}

// 获取客户回访任务
export function getReturnPlanListByCustomerId(id) {
  return axios({
    url: '/customerDetails/returnPlanListByCustomerId/' + id,
    method: 'get',
  })
}

// 获取客户回访记录
export function getReturnListByCustomerId(id) {
  return axios({
    url: '/customerDetails/returnListByCustomerId/' + id,
    method: 'get',
  })
}

// 获取客户回访列表
export function getReturnList(query) {
  return axios({
    url: '/customer/customerDetails/returnList/list',
    method: 'get',
    params: query
  })
}

//回访计划回访提交，内容更新
export function submitConten(query) {
  return axios({
    url: '/customer/customerDetails/returnList/submit',
    method: 'post',
    params: query
  })
}


// 获取客户回访记录
export function getReturnRecordById(query) {
  return axios({
    url: '/customerDetails/returnRecord/list',
    method: 'get',
    params: query
  })
}

// 获取客户咨询详情
export function getConsultationByCustomerId(id) {
  return axios({
    url: '/customerDetails/consultationByCustomerId/' + id,
    method: 'get',
  })
}


//客户消费
export function getConsumptionByCustomerId(id) {
  return axios({
    url: '/customerDetails/consumptionByCustomerId/' + id,
    method: 'get',
  })
}

//消费明细
export function getConsumptionDetailById(id) {
  return axios({
    url: '/customerDetails/consumptionItemByCustomerId/' + id,
    method: 'get',
  })
}

//分诊记录
export function getTriageById(id) {
  return axios({
    url: '/customerDetails/receiveListByCustomerId/' + id,
    method: 'get',
  })
}

//账目/消费
export function getCustomerAmtByCustomerId(id) {
  return axios({
    url: '/customerDetails/customerAmtByCustomerId/' + id,
    method: 'get',
  })
}


//治疗历史
export function getTreatmentById(id) {
  return axios({
    url: '/customerDetails/treatment/' + id,
    method: 'get',
  })
}

//投诉情况
export function getComplaintById(id) {
  return axios({
    url: '/customerDetails/complaint/' + id,
    method: 'get',
  })
}

//客户资料变动
export function getProfileLogById(id) {
  return axios({
    url: '/customerDetails/profileLog/' + id,
    method: 'get',
  })
}
//获取数据字典
export function getDictionary() {
  return axios({
    url: '/customer/customerDetails/Dict',
    method: 'get',
  })
}
//获取全员员工接口
export function AllHisUser() {
  return axios({
    url: '/common/user',
    method: 'get',
  })
}

//获取全员员工接口-班组模块
export function AllHisUser1() {
  return axios({
    url: '/common/user1',
    method: 'get',
  })
}



//获取客户登记
export function CustomerLevel() {
  return axios({
    url: '/common/customerLevel',
    method: 'get',
  })
}
//获取客户状态
export function CustomerState() {
  return axios({
    url: '/common/customerState',
    method: 'get',
  })
}
//修改联系方式
export function UpdateContact(params) {
  return axios({
    url: '/customerDetails/customerContactSaveOrUpdate',
    method: 'post',
    data:params
  })
}
//修改客户资料
export function updateDetails(params) {
  return axios({
    url: '/customer/updateCustomerById',
    method: 'post',
    data:params
  })
}

//获取客户手机号码
export function getUserTel(id) {
  return axios({
    url: `/common/phoneBox/getTel/${id}`,
    method: 'get',
  })
}

export function recharge(data){
  return axios({
    url:'/customer/Recharge',
    method:'POST',
    data:data
  })
}

export function getcreator(){
  return axios({
    url:'/customer/getcreator',
    method:'get'
  })
}

//接待明细表
export function receptionList(params){
  return axios({
    url:'/customer/CustomerReception/list',
    method:'post',
    data:params
  })
}
//接待明细表
export function ReceptionCountList(params){
  return axios({
    url:'/customer/CustomerReception/countList',
    method:'post',
    data:params
  })
}
// 受理类型
export function getAcceptanceType(){
  return axios({
    url:'/common/dict/acceptType',
    method:'get', 
  })
}



// 后台 做过分页的查询接口 前端表格 做分组筛选
/**
 * customerId：顾客的id
   api_name：你要筛选的具体接口名称
   filter_name：你要筛选的具体字段名称(多个)
 */
export function  SelectGroupBy(params){
   return axios({
     url:'/dataFilter/customerDetailFilter',
     method:'get',
     params
   })


}




